package com.zqwh.tools.greendao;

import java.util.Map;

import org.greenrobot.greendao.AbstractDao;
import org.greenrobot.greendao.AbstractDaoSession;
import org.greenrobot.greendao.database.Database;
import org.greenrobot.greendao.identityscope.IdentityScopeType;
import org.greenrobot.greendao.internal.DaoConfig;

import com.zqwh.xtool.greendao.db.CheckOrderDetail;
import com.zqwh.xtool.greendao.db.CheckOrderMaster;
import com.zqwh.xtool.greendao.db.Device;
import com.zqwh.xtool.greendao.db.LendOrder;
import com.zqwh.xtool.greendao.db.LendOrderDetail;
import com.zqwh.xtool.greendao.db.Stock;
import com.zqwh.xtool.greendao.db.Tool;
import com.zqwh.xtool.greendao.db.User;

import com.zqwh.tools.greendao.CheckOrderDetailDao;
import com.zqwh.tools.greendao.CheckOrderMasterDao;
import com.zqwh.tools.greendao.DeviceDao;
import com.zqwh.tools.greendao.LendOrderDao;
import com.zqwh.tools.greendao.LendOrderDetailDao;
import com.zqwh.tools.greendao.StockDao;
import com.zqwh.tools.greendao.ToolDao;
import com.zqwh.tools.greendao.UserDao;

// THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT.

/**
 * {@inheritDoc}
 * 
 * @see org.greenrobot.greendao.AbstractDaoSession
 */
public class DaoSession extends AbstractDaoSession {

    private final DaoConfig checkOrderDetailDaoConfig;
    private final DaoConfig checkOrderMasterDaoConfig;
    private final DaoConfig deviceDaoConfig;
    private final DaoConfig lendOrderDaoConfig;
    private final DaoConfig lendOrderDetailDaoConfig;
    private final DaoConfig stockDaoConfig;
    private final DaoConfig toolDaoConfig;
    private final DaoConfig userDaoConfig;

    private final CheckOrderDetailDao checkOrderDetailDao;
    private final CheckOrderMasterDao checkOrderMasterDao;
    private final DeviceDao deviceDao;
    private final LendOrderDao lendOrderDao;
    private final LendOrderDetailDao lendOrderDetailDao;
    private final StockDao stockDao;
    private final ToolDao toolDao;
    private final UserDao userDao;

    public DaoSession(Database db, IdentityScopeType type, Map<Class<? extends AbstractDao<?, ?>>, DaoConfig>
            daoConfigMap) {
        super(db);

        checkOrderDetailDaoConfig = daoConfigMap.get(CheckOrderDetailDao.class).clone();
        checkOrderDetailDaoConfig.initIdentityScope(type);

        checkOrderMasterDaoConfig = daoConfigMap.get(CheckOrderMasterDao.class).clone();
        checkOrderMasterDaoConfig.initIdentityScope(type);

        deviceDaoConfig = daoConfigMap.get(DeviceDao.class).clone();
        deviceDaoConfig.initIdentityScope(type);

        lendOrderDaoConfig = daoConfigMap.get(LendOrderDao.class).clone();
        lendOrderDaoConfig.initIdentityScope(type);

        lendOrderDetailDaoConfig = daoConfigMap.get(LendOrderDetailDao.class).clone();
        lendOrderDetailDaoConfig.initIdentityScope(type);

        stockDaoConfig = daoConfigMap.get(StockDao.class).clone();
        stockDaoConfig.initIdentityScope(type);

        toolDaoConfig = daoConfigMap.get(ToolDao.class).clone();
        toolDaoConfig.initIdentityScope(type);

        userDaoConfig = daoConfigMap.get(UserDao.class).clone();
        userDaoConfig.initIdentityScope(type);

        checkOrderDetailDao = new CheckOrderDetailDao(checkOrderDetailDaoConfig, this);
        checkOrderMasterDao = new CheckOrderMasterDao(checkOrderMasterDaoConfig, this);
        deviceDao = new DeviceDao(deviceDaoConfig, this);
        lendOrderDao = new LendOrderDao(lendOrderDaoConfig, this);
        lendOrderDetailDao = new LendOrderDetailDao(lendOrderDetailDaoConfig, this);
        stockDao = new StockDao(stockDaoConfig, this);
        toolDao = new ToolDao(toolDaoConfig, this);
        userDao = new UserDao(userDaoConfig, this);

        registerDao(CheckOrderDetail.class, checkOrderDetailDao);
        registerDao(CheckOrderMaster.class, checkOrderMasterDao);
        registerDao(Device.class, deviceDao);
        registerDao(LendOrder.class, lendOrderDao);
        registerDao(LendOrderDetail.class, lendOrderDetailDao);
        registerDao(Stock.class, stockDao);
        registerDao(Tool.class, toolDao);
        registerDao(User.class, userDao);
    }
    
    public void clear() {
        checkOrderDetailDaoConfig.clearIdentityScope();
        checkOrderMasterDaoConfig.clearIdentityScope();
        deviceDaoConfig.clearIdentityScope();
        lendOrderDaoConfig.clearIdentityScope();
        lendOrderDetailDaoConfig.clearIdentityScope();
        stockDaoConfig.clearIdentityScope();
        toolDaoConfig.clearIdentityScope();
        userDaoConfig.clearIdentityScope();
    }

    public CheckOrderDetailDao getCheckOrderDetailDao() {
        return checkOrderDetailDao;
    }

    public CheckOrderMasterDao getCheckOrderMasterDao() {
        return checkOrderMasterDao;
    }

    public DeviceDao getDeviceDao() {
        return deviceDao;
    }

    public LendOrderDao getLendOrderDao() {
        return lendOrderDao;
    }

    public LendOrderDetailDao getLendOrderDetailDao() {
        return lendOrderDetailDao;
    }

    public StockDao getStockDao() {
        return stockDao;
    }

    public ToolDao getToolDao() {
        return toolDao;
    }

    public UserDao getUserDao() {
        return userDao;
    }

}
